﻿
-- ================================================
-- Remarks: 
-- ================================================
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO

IF EXISTS (SELECT * FROM sysobjects WHERE type = 'P' AND name = 'Dasideen_ContentFeedback_GetByContentCode') 
    BEGIN
        DROP  PROCEDURE  Dasideen_ContentFeedback_GetByContentCode
    END
GO

CREATE PROCEDURE [Dasideen_ContentFeedback_GetByContentCode]
-- =============================================
-- Author:		<Sagar s.k>
-- Create date: <19/03/2015>
-- Description:	<Dasideen_ContentFeedback_GetByContentCode>
-- =============================================
-- Add the parameters for the stored procedure here
	(
		@ContentCode varchar(50),
		@Sys_IsDeleted int = 0,
	    @Sys_OrganizationID int = -1
		 
	)
AS 
    BEGIN
	-- SET NOCOUNT ON added to prevent extra result sets from
	-- interfering with SELECT statements.
    SET NOCOUNT OFF;

    -- Insert statements for procedure here
	SELECT     
	       [ContentFeedback].[ContentFeedbackKey],
		   [ContentFeedback].[ContentFeedbackContentKey], 
		   [ContentFeedback].[ContentFeedbackFeedbackKey], 
		   [ContentFeedback].[ContentFeedbackText], 
		   [ContentFeedback].[ContentFeedbackDate], 
           [ContentFeedback].[ContentFeedbackAuthorUserKey], 
		   [ContentFeedback].[ContentFeedbackAuthorName], 
		   [ContentFeedback].[ContentFeedbackAuthorEmail], 
		   [ContentMetaDataMaster].[ContentCode]
    FROM   [ContentFeedback] LEFT OUTER JOIN
           [ContentMetaDataMaster] ON [ContentFeedback].[ContentFeedbackContentKey] = [ContentMetaDataMaster].[ContentKey]
    WHERE  (
	            [ContentMetaDataMaster].[ContentCode] = @ContentCode AND
				[ContentFeedback].[Sys_IsDeleted] = @Sys_IsDeleted AND
				[ContentFeedback].[Sys_OrganizationID] = @Sys_OrganizationID

		   )
    ORDER BY    [ContentFeedback].[ContentFeedbackText]   
          
    
END
GO
